package com.kitten.relation_user.biz.domain.mapper;

import com.kitten.relation_user.biz.domain.dataobject.FansDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FansDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(FansDO record);

    int insertSelective(FansDO record);

    FansDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FansDO record);

    int updateByPrimaryKey(FansDO record);

    /**
     * 删除粉丝记录
     * @param userId
     * @param fansUserId
     * @return
     */
    int deleteByUserIdAndFansUserId(@Param("userId") Long userId,
                                    @Param("fansUserId") Long fansUserId);

    /**
     * 分页查询用户粉丝数量
     * @param userId
     * @return
     */
    long selectCountByUserId(Long userId);

    List<FansDO> selectPageListByUserId(@Param("userId") Long userId,
                                        @Param("offset") Long offset,
                                        @Param("limit") Long limit);

    /**
     * 查询用户粉丝列表 (5000条)
     * @param userId
     * @return
     */
    List<FansDO> select5000FansByUserId(Long userId);
}